Code Description

Our implementation of the DWT based compression algorithm was carried out in C++ in the Linux environment. We used an Object Oriented approach to the problem, a summary of which is given in this page.

We constructed the following objects for our implementation:

The Signal Object

The signal object represents a 2-D signal. It represents the input image as an array of float data. Member functions include:

The Subbands Object

The subbands object represents the subbands of a decomposed 2-D signal. It is a collection of signal objects. Member functions coded include:

The Filter Object

The filter object represents a 2-D FIR filter implemented in the form of a non-separable Filter (2-D convolution). A signal object represents the impulse response of a filter object. Member functions include:

 The Bank Object

A bank object is a collection of filter object (and associated "wiring" information) that constitute a Filter Bank. It can either be an analysis filter bank or a synthesis bank. The structure of the bank object is such that it can allow implementation of any arbitrary configuration of filters. Member Functions include:

The Main Program

 The main program initializes the input signal and the banks and inputs the input signal to the bank. The output of the bank are subbands of the decomposed signal representing its 2-D DWT. A Rate Constraint is taken from the user and the program enters into a recursive procedure to determine the optimal bit allocations (according to the bit allocation algorithm based on Rate Distortion Theory for (near) gaussian distributed signals [Strang]). The subbands are then quantized, their entropies calculated and finally written to disk. The gzip utility is then called to perform the LZ coding step.

The quantized subbands are then used to reconstruct the image. Entropy, PSNR & time consumed are displayed..